import {useSelector} from "react-redux"
import {RootState} from "../store/index"

export default () => {
  const {token, refresh_token, expiresAt, userID} = useSelector((state: RootState) => state.auth)
  if (!token || !refresh_token || !expiresAt || !userID) return false
  if (Date.now() > expiresAt) return false
  return true
}